import React, { memo } from 'react';
import { Col, Form, Row } from 'antd';
import { UploadOssCompact } from '@/containers';

const formItemLayout = {
    labelCol: { span: 6 },
    wrapperCol: { span: 14 }
};

const ViewContent = ({ formValueMap = {}, appendRow = null }) => (
    <Form {...formItemLayout}>
        <Row>
            <Row>
                <Col span={12}>
                    <Form.Item label="关联申请">{formValueMap.leaveDate}</Form.Item>
                </Col>
                <Col span={12}>
                    <Form.Item label="离职类型">{formValueMap.leaveType}</Form.Item>
                </Col>
            </Row>
            <Row>
                <Col span={12}>
                    <Form.Item label="离职日期">{formValueMap.leaveDate}</Form.Item>
                </Col>
            </Row>
            <Row>
                <Col span={12}>
                    <Form.Item label="离职原因">{formValueMap.leaveReason}</Form.Item>
                </Col>
            </Row>
            <Row>
                <Col span={12}>
                    <Form.Item label="补充说明">
                        <UploadOssCompact
                            rules={[{ max: 20 }, { type: ['pdf', 'doc', 'docx', 'jpg', 'jpeg', 'rar', 'zip'] }]}
                            editable={false}
                            value={formValueMap.leaveAttachment}
                        />
                    </Form.Item>
                </Col>
            </Row>
            <Row>
                <Col span={12}>
                    <Form.Item label="面谈时间">{formValueMap.leaveType}</Form.Item>
                </Col>
                <Col span={12}>
                    <Form.Item label="面谈地点">{formValueMap.leaveDate}</Form.Item>
                </Col>
            </Row>
            {appendRow}
        </Row>
    </Form>
);
export default memo(ViewContent);
